import { getNewsByIdAPI } from "../../api/news";
import { NewsSaveList } from "./actionTypes";

export const getNewsByIdAction = (id) => {
  return async (dispatch) => {
    const res = await getNewsByIdAPI(id);
    // 2. dispatch触发同步Action
    dispatch({ type: NewsSaveList, payload: res.data.results });
  };
};
